--[[
    Longer Trains 0.1
    Copyright (C) 2011 Dzakub

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
]]

g_Root = getRootElement()

local lsLocomotive = {direction=true, x=1695.435546875, y=-1954.3416748047, z=15.241115570}
local sfLocomotive = {direction=true, x=-1943.2305908203, y=173.29827880859, z=27.36611557006}
local lvLocomotive = {direction=true, x=-2864.75, y=1253.7197265625, z=12.349542617798}

local lsMarker = createMarker(1746.9229736328, -1943.5786132813, 12.593406677246, "cylinder", 1, 0, 255, 255, 153)
local sfMarker = createMarker(-1958.7010498047, 163.81016540527, 26.712514877319, "cylinder", 1, 0, 255, 255, 153)
local lvMarker = createMarker(2856.8254394531, 1267.0706787109, 10.415639877319, "cylinder", 1, 0, 255, 255, 153)

-- Freight - 1 / Streak - 2
function createTrain(trType, place)
	
end

function initWindow(hitElement)
	if (source == lsMarker) or (source == sfMarker) or (source == lvMarker) then
		if getElementType(hitElement) == "player" then
			triggerClientEvent(hitElement, "onPlayerEnterTrainMarker", g_Root)
		end
	end
end

addEventHandler("onMarkerHit", g_Root, initWindow)